package thread;

public class threadDeom6 {
    public static void main(String[] args) throws InterruptedException {
       /* Thread t1=new Thread(new Runnable() {
            @Override
            public void run() {

            }
        },"这是我的线程");*/

        Thread t=new Thread(()->{
                System.out.println("这是thread线程");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
        },"我的线程");
        System.out.println("线程创建之前"+t.isAlive());
        t.start();

        /*System.out.println("线程启动之后"+t.isAlive());
        Thread.sleep(3000);//保证t线程结束
        System.out.println("t线程结束之后"+t.isAlive());
        System.out.println(t.getId()+"  "+t.getName());
        System.out.println(t.getState());*/
    }
}
/*class mythread2 extends Thread{
    @Override
    public void run(){

    }
}*/
